<?php
/**
 * By   :    Robert Wilson Nargetey
 * Date :    4/21/12
 * Time :    1:48 PM
 * File :    Session.php
 */
session_name('_e-major');
session_start();

class Session
{

    private static $islogin = false;

    protected static function set($key, $role)
    {
        $_SESSION[$key] = $role;
    }

    public static function get($key)
    {
        if (isset($_SESSION[$key])) {
            return $_SESSION[$key];
        } else {
            return false;
        }
    }

    public static function dologout()
    {

        if (isset($_SESSION)) {
            foreach ($_SESSION as $key => $value) {
                unset($_SESSION[$key]);
            }
            session_destroy();
            header("Location: ./");
            exit;
        }

    }
}
